﻿@model AutoPartsSearch.Web.ViewModels.AccountModels.SellerInfo
@using AutoPartsSearch.Domain.Entities.Enums
@{
    ViewBag.Title = @T("Детали").ToHtmlString();
}
<h2 class="title">@T("Детали")</h2>
<div class="block-full">
    <p class="lh16">
        @T("Здесь вы можете откорректировать Ваши данные," +
         " а также изменить фильтры (модели автомобилей и тип запчастей)" +
         ", по которым запросы покупателей будут подать к Вам.")
    </p>
</div>
<div class="container-main ui-corner-all padtop5">
    @using (Html.BeginForm("UpdateAccount", "Account"))
    {
        <div id="errors" title="@T("Пожалуйста, исправьте ошибки и попробуйте еще раз.")">
            @Html.ValidationSummary(false)
        </div>
        <fieldset>
            <div class="container-sub">
                <div class="container-header hght18px mrgbot3">
                    <span class="headerAdditionalInfo"><span class="red">*</span> - @T("обязательное поле")</span>
                </div>
                <table id="step1" class="table-form">
                    <tbody>
                        <tr>
                            <td>
                                <label for="FullName">@T("Название компании / ФИО") :
                                </label>
                            </td>
                            <td>
                                @Html.DisplayFor(model => model.CompanyName)
                                @Html.HiddenFor(model => model.CompanyName)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Code)
                            </td>
                            <td class="bold red">
                                @Html.DisplayFor(model => model.Code)
                                @Html.HiddenFor(model => model.Code)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.EMail)
                            </td>
                            <td>
                                @Html.DisplayFor(model => model.EMail)
                                @Html.HiddenFor(model => model.EMail)
                            </td>
                        </tr>
                        @if (!Model.IsIndividual)
                        {
                            <tr>
                                <td>
                                    @Html.RequiredLabelFor(model => model.FullName)
                                </td>
                                <td>
                                    @Html.EditorFor(x => x.FullName)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    @Html.RequiredLabelFor(model => model.DirectorName)
                                </td>
                                <td>
                                    @Html.EditorFor(x => x.DirectorName)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    @Html.RequiredLabelFor(model => model.INN)
                                </td>
                                <td>
                                    @Html.EditorFor(x => x.INN)
                                </td>
                            </tr>
                        }
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Adress)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.Adress)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.City)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.City)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Site)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.Site)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.CarBrands)
                            </td>
                            <td>
                                @Html.ListBoxFor(model => model.CarBrands, Enumerable.Empty<SelectListItem>())
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.PartGroups)
                            </td>
                            <td>
                                @Html.ListBoxFor(model => model.PartGroups, Enumerable.Empty<SelectListItem>())
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.ReceiveQueriesByEmail)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.ReceiveQueriesByEmail)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Phone)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.Phone)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Phone2)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.Phone2)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.MobilePhone)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.MobilePhone)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                @Html.RequiredLabelFor(model => model.Sign)
                            </td>
                            <td>
                                @Html.EditorFor(model => model.Sign)
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="container-sub mrgtop3 hght31px">
                <input class="button fr" type="submit" value="@T("Сохранить")" />
            </div>
        </fieldset>
        
    }
</div>
@section Styles{
    <link rel="stylesheet" href="~/Content/themes/base/jquery.multiselect.css" />
}
@section Scripts{
    <script type="text/javascript" language="javascript" src="~/Scripts/jquery.multiselect.js"></script>
    <script type="text/javascript" language="javascript" src="~/Scripts/query.js"> </script>
    <script type="text/javascript" src="~/Scripts/jquery.validate-vsdoc.js"> </script>
    <script type="text/javascript" src="~/Scripts/jquery.validate.unobtrusive.min.js"> </script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            
            var checkAllText = '@T("Выбрать все")';
            var uncheckAllText = '@T("Снять все")';
            var noneSelectedText = '@T("Выберите")';
            var selectedText = '# @T("выбрано")';
            
            $('#City').dictselect('@Url.Action("ByType", "Dictionaries", new { type = DictionaryType.Cities })', {
                setDefault: false,
                selectedValue: @Model.City.Value
            });
            
            $('#CarBrands').groupedmultiselect('@Url.Action("ByDictionaryTypeParent", "Dictionaries", new { type = DictionaryType.CarTypes })', {
                values: @AutoPartsSearch.Domain.Common.Converter.ToJsonArray(Model.CarBrands),
                checkAllText: checkAllText,
                uncheckAllText: uncheckAllText,
                noneSelectedText: noneSelectedText,
                selectedText: selectedText
            });
            
            $('#PartGroups').dictmultiselect('@Url.Action("ByType", "Dictionaries", new { type = DictionaryType.PartGroups })', {
                values: @AutoPartsSearch.Domain.Common.Converter.ToJsonArray(Model.PartGroups),
                checkAllText: checkAllText,
                uncheckAllText: uncheckAllText,
                noneSelectedText: noneSelectedText,
                selectedText: selectedText
            });
        });
    </script>
}
